package org.jeecg.modules.business.job;

import lombok.extern.slf4j.Slf4j;
import org.jeecg.modules.business.job.service.SyncService;
import org.jeecg.modules.business.transfer.service.IPaperWarningService;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;

/*
 * 项目名称:    wms-server-jeecg
 * 接口描述:    纸筒库存预警定时任务
 * 创建人员:    lumingyi
 * 创建时间:    2023-11-13
 */
@Service
@Slf4j
public class PaperWarningJob implements Job {

    @Autowired
    private IPaperWarningService paperWarningService;

    @Override
    @Async
    public void execute(JobExecutionContext context) throws JobExecutionException {
        try {
            paperWarningService.checkSafeInventory();
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
}
